home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib1 / v_01_02 / 1n02077a < prev    next >
Encoding:
Text File  |  1995-11-01  |  697 b   |  30 lines

  1.  
  2. /* get_response() is the menu() and dir_menu() operator selection function */
  3. /* that returns the character selected by keyboard or the mouse selection */
  4. /* if mouse_flag is not zero */
  5.  
  6. static int get_response()
  7. {
  8.     int ret_val= -1;
  9.  
  10.     while(ret_val == -1)
  11.     {
  12.         if((mouse_flag != MOUSE_ONLY) && kbhit())
  13.         {
  14.             ret_val=getch();
  15.             if(ret_val==ALT)
  16.                 ret_val=get_extended_key();
  17.                 /* clear the keyboard buffer */
  18.             while(kbhit())
  19.                 getch();
  20.         }
  21.         else
  22.             if(mouse_flag != KEYBOARD_ONLY)
  23.                 ret_val=mouse_read();
  24.  
  25.     }
  26.     return ret_val;
  27.  
  28. }
  29.  
  30.